import React, { useEffect, useState } from 'react'
import * as api from './server'
import { useHistory } from 'react-router-dom'
import { NavBar } from 'antd-mobile';
const Collect = () => {
    const history = useHistory();
    const [list, setList] = useState([]);
    useEffect(() => {
        api.getCollect('HL1115')
            .then(res => {
                console.log(res)
                setList(res.data)
            })
    }, [])
    return (
        <div>
            <NavBar onBack={history.goBack} >收藏列表</NavBar>
            {
                list.map(item => {
                    return <li key={item.id}>{item.title}</li>
                })
            }
        </div>
    )
}

export default Collect